Simulation #1

Data structure: \(O = (W, A, Z, Y)\)

  • U - exogenous variables
  • W - baseline covariate that is a measure of body condition
  • A - treatment level based on W, continuous between 0 and 5
  • Z - intermediate curve based on W and A
  • Y - outcome, indicator of an event ?

Underlying data generating process, \(P_{U,X}\)

  • Exogenous variables:
    • \(U_A \sim Normal(\mu=0, \sigma^2 = 1^2)\)
    • \(U_A \sim Normal(\mu=0, \sigma^2 = 2^2)\)
    • \(U_Z \sim Uniform(min = 0, max = 1)\)
    • \(U_Y \sim Uniform(min = 0, max = 1)\)
  • Structural equations F and endogenous variables:
    • \(W = U_W\)
    • \(A = bound(2 - 0.5W + U_A, min=0, max=5)\)
    • \(Z = \mathbf{I}[U_Z < expit(2-W-A)]\)
    • \(Y = \mathbf{I}[U_Y < expit(W + 5*A + Z - 0.5 * W * A - 8)]\)
##        W                   A                Z                Y         
##  Min.   :-3.621518   Min.   :0.0000   Min.   :0.0000   Min.   :0.0000  
##  1st Qu.:-0.679262   1st Qu.:0.6206   1st Qu.:0.0000   1st Qu.:0.0000  
##  Median : 0.009607   Median :2.0124   Median :0.0000   Median :1.0000  
##  Mean   : 0.000817   Mean   :2.1258   Mean   :0.4865   Mean   :0.5984  
##  3rd Qu.: 0.669635   3rd Qu.:3.4071   3rd Qu.:1.0000   3rd Qu.:1.0000  
##  Max.   : 3.992957   Max.   :5.0000   Max.   :1.0000   Max.   :1.0000
## Summary of A given W < -1:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   0.000   1.359   2.780   2.723   4.215   5.000
## Summary of A given -1 < W <= 0:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.0000  0.8095  2.2315  2.2738  3.5758  5.0000
## Summary of A given 0 < W <= 1:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.0000  0.4891  1.8463  1.9809  3.1937  5.0000
## Summary of A given 1 < W:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   0.000   0.000   1.160   1.531   2.591   5.000

## 
## Call:
## glm(formula = Y ~ W + A + W * A + Z, family = binomial, data = obs)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -3.8257  -0.0711   0.0006   0.0541   3.6169  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -8.0291     0.2560 -31.361  < 2e-16 ***
## W             1.1818     0.1871   6.317 2.67e-10 ***
## A             5.0013     0.1459  34.269  < 2e-16 ***
## Z             1.0548     0.1193   8.838  < 2e-16 ***
## W:A          -0.5794     0.1234  -4.697 2.64e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 13473.1  on 9999  degrees of freedom
## Residual deviance:  2543.3  on 9995  degrees of freedom
## AIC: 2553.3
## 
## Number of Fisher Scoring iterations: 9
## [1] "    MSE: 379.9254, AUC: 0.9898"

n = 200

CV HAL

results

## CV selected lambda (from one sample): 0.0086251603748726

1000 repetition

## The average of CV selected lambdas (from 1000 sample): 0.00793684388619338 The average of CV selected lambdas (from 1000 sample): 0.00792057260113451 The average of CV selected lambdas (from 1000 sample): 0.00792340491044921
## z=1:

## z=0:

Globally Undersmoothed HAL

results

## Undersmoothed lambda: 0.00010990826113378
##  which is 0.0127427498570313 * lambda_CV

1000 repetition

## The average of unsersmoothed lambda (from 1000 sample): 0.000110282693674584
##  which is 0.0144431693912157 * the average of 1000 lambda_CV
## z=1:

## z=0:

Oevr a grid of lambda scalers

## TableGrob (7 x 4) "arrange": 7 grobs
##   z     cells    name                 grob
## 1 1 (2-3,2-3) arrange       gtable[layout]
## 2 2 (4-5,1-2) arrange       gtable[layout]
## 3 3 (4-5,3-4) arrange       gtable[layout]
## 4 4 (6-7,1-2) arrange       gtable[layout]
## 5 5 (6-7,3-4) arrange       gtable[layout]
## 6 6 (3-3,4-4) arrange    gtable[guide-box]
## 7 7 (1-1,1-4) arrange text[GRID.text.1916]

## TableGrob (7 x 4) "arrange": 7 grobs
##   z     cells    name                 grob
## 1 1 (2-3,2-3) arrange       gtable[layout]
## 2 2 (4-5,1-2) arrange       gtable[layout]
## 3 3 (4-5,3-4) arrange       gtable[layout]
## 4 4 (6-7,1-2) arrange       gtable[layout]
## 5 5 (6-7,3-4) arrange       gtable[layout]
## 6 6 (3-3,4-4) arrange    gtable[guide-box]
## 7 7 (1-1,1-4) arrange text[GRID.text.2192]

## TableGrob (7 x 4) "arrange": 7 grobs
##   z     cells    name                 grob
## 1 1 (2-3,2-3) arrange       gtable[layout]
## 2 2 (4-5,1-2) arrange       gtable[layout]
## 3 3 (4-5,3-4) arrange       gtable[layout]
## 4 4 (6-7,1-2) arrange       gtable[layout]
## 5 5 (6-7,3-4) arrange       gtable[layout]
## 6 6 (3-3,4-4) arrange    gtable[guide-box]
## 7 7 (1-1,1-4) arrange text[GRID.text.2468]